﻿#pragma once
#include "Node.h"
#include "Transform.h"
#include "Component.h"
#include <list>
#include <string>
#include <memory>

namespace DYEngine
{
	class GameObject : public Node
	{
	public:
		GameObject();
		GameObject(std::string const& pName);
		void SetActive(bool pIsActive);
		virtual ~GameObject();
	public:
		bool IsActive() const
		{
			return mIsActive;
		}

		void AddComponent(Component* pComp)
		{
			pComp->mGameObject = this;
			mComponents.push_back(pComp);
		}

		void RemoveComponent(Component* pComp)
		{
			mComponents.remove(pComp);
		}
	private:
		std::list<Component*> mComponents;

		bool mIsActive = true;
	};
}